﻿/*
 * DllModule.h
 *
 */

#ifndef __GDK_DLLMODULE_H__
#define __GDK_DLLMODULE_H__


#include <gdk/core/Types.h>
#include <gdk/core/Unknown.h>
#include <gdk/core/String.h>



namespace gdk 
{


	class GDK_CORE_EXPORT DllModule : virtual public Unknown
	{
		DECLARE_CLASS_HANDLE(DllModule)
		DECLARE_CLASS_INSTANCE(DllModule)

	private:
#ifdef _WIN32
#else
		typedef int*	HMODULE;
#endif

		HMODULE			_dllModule; 
		String			_fileName;


	protected:
		__INLINE__ DllModule(void)
			:_dllModule(NULL)
		{
		}

	public:
		__INLINE__ String const& getFileName(void) const { return _fileName; }
		void* getProcAddress(Char const *procName) const;

	public:
		virtual bool load(const String &fileName);
		virtual void unload(void);
	};



} //namespace gdk






#endif //__GDK_DLLMODULE_H__
